feat(exec): add --privileged and --data-env flags#570
Merged
Conversation
Faithful port of #435 (Netanel Gilad) with the renamed flags: - --privileged sends the X-Bypass-RLS header (bypass RLS) - --data-env <environment> sends the X-Data-Env header Both flow exec.ts -> run-script.ts (BASE44_PRIVILEGED / BASE44_DATA_ENV env vars) -> the Deno wrapper, which builds the SDK request headers. Open backend questions surfaced during review (RLS-bypass exposure and prod-edge survival, data-env value validation, and data-env scope for backend-function invocations) are flagged inline as QUESTION(@netanelgilad) comments for Netanel to resolve at review. Refs #435 Co-Authored-By: Netanel Gilad <netanelg@wix.com> Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Contributor
🚀 Package Preview Available!Install this PR's preview build with npm: npm i @base44-preview/cli@0.1.5-pr.570.3e2e87ePrefer not to change any import paths? Install using npm alias so your code still imports npm i "base44@npm:@base44-preview/cli@0.1.5-pr.570.3e2e87e"Or add it to your {
"dependencies": {
"base44": "npm:@base44-preview/cli@0.1.5-pr.570.3e2e87e"
}
}
Preview published to npm registry — try new features instantly! |
Netanel's calls: no CLI-side value validation (server's job), and the backend-function invocation scope is a backend concern, not the CLI's. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
davidsu
force-pushed
the
feat/exec-privileged-data-env
branch
from
July 23, 2026 07:50
38ed231 to
2d38b3f
Compare
The X-Bypass-RLS header is gated to editors server-side in EntityCRUD (_verify_admin_permissions); no CLI-side concern remains. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
netanelgilad
approved these changes
Jul 23, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Note
Description
Adds two new flags to the
base44 execcommand:--privilegedand--data-env.--privilegedruns the script with admin privileges by sending theX-Bypass-RLSheader (bypassing row-level security), and--data-env <environment>targets a specific data environment via theX-Data-Envheader. This lets users run one-off scripts against different data environments and with elevated access when their role permits.Related Issue
Ported from #435
Type of Change
Changes Made
--privilegedand--data-env <environment>options to theexeccommand, including help text and a usage example.privilegedanddataEnvthroughrunScript()(RunScriptOptions), forwarding them to the Deno subprocess as theBASE44_PRIVILEGEDandBASE44_DATA_ENVenvironment variables.deno-runtime/exec.ts) to read those env vars and attach theX-Bypass-RLSandX-Data-Envheaders to the SDK client when set.Testing
npm test)Checklist
docs/(AGENTS.md) if I made architectural changesAdditional Notes
The
--privilegedflag requires the caller to have an app owner/editor role; enforcement is handled server-side via theX-Bypass-RLSheader. Both headers are only sent when the corresponding flag is provided.🤖 Generated by Claude | 2026-07-23 08:57 UTC | 3e2e87e